package star.cloud.asme.consumable.overview;

import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import star.cloud.asme.base.dto.Result;
import star.cloud.asme.base.mybatis.IBaseController;

import java.util.List;

@RestController
@RequestMapping("/consumable")
@RequiredArgsConstructor
public class ConsumableController implements IBaseController<Consumable> {

    private final ConsumableService consumableService;

    @Override
    public Result<Consumable> getOneByCondition(String columnName, Object columnValue) {
        return consumableService.getOneByCondition(columnName, columnValue);
    }

    @Override
    public Result<List<Consumable>> getListByCondition(String columnName, Object columnValue) {
        return consumableService.getListByCondition(columnName, columnValue);
    }

    @Override
    public Result<List<Consumable>> getListByConditions(Consumable conditions) {
        return consumableService.getListByConditions(conditions);
    }

    @Override
    public Result<IPage<Consumable>> getListByConditionsWithPage(Consumable conditions) {
        return consumableService.getListByConditionsWithPage(conditions);
    }

    @Override
    public Result<Consumable> insertOne(Consumable entity) {
        return consumableService.insertOne(entity);
    }

    @Override
    public Result<Consumable> updateOne(Consumable entity) {
        return consumableService.updateOne(entity);
    }

    @Override
    public Result<?> logicalDeleteById(Long id) {
        return consumableService.logicalDeleteById(id);
    }

    @Override
    public Result<?> activeById(Long id) {
        return consumableService.activeById(id);
    }
}
